package com.example.teesystem.entity.vo.library;

import com.example.teesystem.common.utils.TimeUtil;
import com.example.teesystem.entity.Issue;
import com.example.teesystem.entity.Library;
import com.example.teesystem.entityDto.IssueBriefMessage;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.Date;

/**
 * @author pxr
 * @data 2022/4/26 14:37
 */
@Data
public class IssueLibraryResponse {
    private Integer id;
    private Integer courseId;
    private Integer issueId;
    private String message;
    private String uploadTime;
    private String title;
    private IssueBriefMessage issueBriefMessage;

    public IssueLibraryResponse(Library library){
        BeanUtils.copyProperties(library, this);
        this.uploadTime = TimeUtil.dateToString(library.getUploadTime());
    }
}
